Technical Field
The present invention relates to an image examination apparatus that performs appearance examination using an image.
Related Art
The image examination apparatus that performs the appearance examination using the image is widely used for the purpose of automation and labor-saving of the examination in a production line. There are various kinds and techniques of the appearance examination. In a basic configuration, an image sensor (camera) captures an image of a to-be-examined object, a portion constituting an examination region is extracted from the obtained image, and a feature of the image of the examination region is analyzed and evaluated to perform an intended examination (for example, non-defective/defective determination, assortment, and information acquisition).
In this kind of image examination apparatus, it is necessary to perform preparatory work such as a setting of the examination region before an examination process is started. In a general apparatus, a dedicated tool is prepared in order to set the examination region, and a user can set the proper examination region according to the to-be-examined object or an examination purpose using the tool. However, the conventional tool only has a function of defining the examination region using simple graphics such as a circle and a rectangle or a combination of the graphics. Accordingly, in the case that the to-be-examined object has a complicated shape or a special shape, sometimes the examination region cannot correctly be matched with a contour of the to-be-examined object. Even if the contour of the to-be-examined object can be expressed by the combination of the simple graphics, it takes lots of time and work load to set the examination region when the number of combined graphics increases. Nowadays, there is a strong need to shorten setup time in order to improve efficiency in multi-product, small-quantity production, and it is undesirable to take time to set the examination region. At the same time, there is also a strong need to correctly set the examination region only to a portion to be examined in order to respond to complication of a product shape or a sophisticated and diversified examination content, or to improve examination accuracy or reliability.
In the case that the to-be-examined object has an individual difference, or in the case that the to-be-examined object is not aligned, it is more difficult to set the examination region. For example, in the case that a vegetable conveyed on a belt conveyor is examined, there are no vegetables having the same shape, and the vegetable is not correctly aligned. Therefore, a position or an orientation of the examination region in the image depends on the to-be-examined object. When the examination is accurately performed, it is necessary to set the examination region every time in each to-be-examined object, or to correct the previously-set examination region every time. For this reason, the automatic examination cannot be performed. When the examination region is sufficiently narrowed compared with the to-be-examined object, the examination region is hardly influenced by the individual difference and a fluctuation of the position or orientation, so that the automatic examination can be performed using the same examination region. However, in this method, there is a risk of generating omission of the examination because a portion going out of the examination region exists.
Conventionally, a technique of extracting the examination region by binarization or gamut extraction is well known as a technique of automatically setting the examination region. That is, a pixel group corresponding to a previously-set luminance range or gamut is extracted from the image, and the pixel group is set to the examination region. The technique is effective for high luminance or color contrast between a portion (foreground) that should be extracted as the examination region and other portions (background), and the response to the complicated shape and the simplification of setting work may be addressed.
However, when shadow is generated by an influence of lighting in the foreground that should be extracted as the examination region, when the foreground is constructed with various pieces of luminance or various colors, or when a color close to the foreground exists in the background, it is difficult to correctly extract only the foreground by the binarization or the gamut extraction. Nowadays, the sophistication and the diversification of the examination content progress, and frequently there is a little color difference between the background and the foreground, for example, surface examination is performed to only one cutting surface of a molded product, or only one component is examined on a printed board on which many components are mounted. Because the binarization or the gamut extraction is performed in each pixel of the image, the binarization or the gamut extraction is easily influenced by a noise or a fluctuation of the lighting, the pixel is lost in the extracted examination region, and the pixel is selected from the background like an enclave, which results in the examination accuracy being degraded.
In Patent Document 1, a method for setting a position or a size of the examination region from CAD data of a to-be-examined component, a method for recognizing the to-be-examined region by calculating a difference between images before and after the component is mounted, and the like are disclosed as the examination region setting method. The use of these methods can automatically set the examination region. However, these methods cannot widely be applied, but these methods lack general versatility.    Patent Document 1: Japanese Unexamined Patent Publication No. 2006-58284    Non-Patent Document 1: Y. Boykov and M.-P. Jolly, “Interactive Graph Cuts for Optimal Boundary & Region Segmentation of Objects in N-D images”, ICCV2001, 01, p. 105 (2001).